﻿using System;
using System.Collections.Generic;
using System.Text;

using MT.eVotePRS.Model;
using MT.eVotePRS.Service;
using MT.eVotePRS.Presentation.Core;

namespace MT.eVotePRS.Presentation.Logic
{
    public class InventoryTableAction : AbstractForm
    {
        InventoryTable _inventTable = null;

        private static readonly InventoryTableService _tblService = InventoryTableService.GetInstance();

        public InventoryTableAction() : base()
        {
            _inventTable = new InventoryTable();
        }

        public InventoryTable Inventory
        {
            get { return _inventTable; }
            set { _inventTable = value; }
        }

        public object CreateNewHandset(InventoryTable inv)
        {
            if (_inventTable != null)
            {
                return _tblService.InsertInventory(inv);
            }
            return null;
        }

        public InventoryTable CheckHandset(string handsetId)
        {
            _inventTable = _tblService.CheckHandset(handsetId);
            return _inventTable;
        }

    }
}
